package amani.wechat.platform.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import amani.wechat.platform.controller.model.ActivtyNews;
import amani.wechat.platform.services.IActivityService;
import amani.wechat.platform.services.IBookService;

/**
 * 活动页面
 * @author VV
 *
 */
@Controller
@RequestMapping("/Activity")
public class ActivityController {
	@Resource(name="ActivityService")
	IActivityService activtyService;
	
	
	@RequestMapping("/Index")
	public String index( Model model) {
		 List<ActivtyNews>  dataActivtyNews=activtyService.getNewsList();
		 model.addAttribute("list", dataActivtyNews); 
		return "activity/index";
		
	}
	
	@RequestMapping("/Details")
	public String details(String newId, Model model) {
		 ActivtyNews  activtyNews=activtyService.getNewsById(newId);
		 model.addAttribute("item", activtyNews); 
		return "activity/details";
	}
}
